package med.movyzer.mobile.main;

import java.util.Timer;
import java.util.TimerTask;

import med.movyzer.mobile.R;
import med.movyzer.mobile.services.AccelService;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class StatsView extends Activity{
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

	    this.setContentView(R.layout.statsview);
	    
	    AccelService service=AccelService.service;

	    TextView nrEvents = (TextView) findViewById(R.id.nrEvents);
	    TextView timerRate = (TextView) findViewById(R.id.timerPeriod);
	    TextView time = (TextView) findViewById(R.id.loggingTime);
	    if(service!=null && service.movements!=null){
	    	nrEvents.setText(nrEvents.getText()+" "+service.movements.size() +" (since last save)");
	    	timerRate.setText(timerRate.getText()+" "+service.timerRate);
	    	time.setText(time.getText()+" "+ service.movements.getStartTime().getTime().toString());
	    }else{
	    	time.setText(time.getText()+" ERROR");
	    }
	}
}
